var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return
    }(mode == 1) ? status++ : status--;
    selectionLog[status] = selection;
    var i = -1;
    if (status <= i++) {
        cm.dispose()
    } else {
        if (status === i++) {
            cm.sendNormalTalk("你也是个优秀的猎人……辛苦你了。", 5, 9001059, false, true)
        } else {
            var reactor = "action分支" + cm.getNumberFromQuestCustomData(9001060);
            eval(reactor)(mode, type, selection, i)
        }
    }
}

function action分支0(g, d, c, b) {
    if (status <= b++) {
        cm.sendNormalTalk("我看到了，即便在那凶残的#r#e火焰狼#n#k面前，你也没有半分的胆怯，而是英勇奋战。", 4, 9001059, false, true)
    } else {
        if (status === b++) {
            cm.sendNormalTalk("能有你这样优秀的猎人帮我的忙，相信#r#e火焰狼#n#k很快就会玩完了……", 4, 9001059, true, true)
        } else {
            if (status === b++) {
                var d = ["普通", "巨大", "惊人", "致命"];
                var e = 5200 * 10000 * 10000 / 100;
                var h = cm.getNumberFromQuestInfo(993000501, "damage");
                if (h <= e / 100) {
                    var a = 0
                } else {
                    if (h <= e / 20) {
                        var a = 1
                    } else {
                        if (h <= e / 10) {
                            var a = 2
                        } else {
                            var a = 3
                        }
                    }
                }
                cm.sendNormalTalk("你对火焰狼造成了#b#e" + d[a] + "#n#k的伤害！\r\n根据你的贡献度，我会先给你相应的#b经验值#k。", 4, 9001059, true, true)
            } else {
                if (status === b++) {
                    cm.sendNormalTalk("日后会有许多勇士继你之后对#r#e火焰狼#n#k造成伤害的，如果#r#e火焰狼#n#k死在其他勇士的手上，你也会根据相应的#b#e贡献度#n#k获得#b#e道具#n#k奖励。", 4, 9001059, true, true)
                } else {
                    if (status === b++) {
                        cm.dispose();
                        var f = cm.getNumberFromQuestCustomData(993000500);
                        if (isNaN(f) || f < 1) {
                            f = 950000100
                        }
                        cm.warp(f, 0);
                        var e = 5200 * 10000 * 10000 / 100;
                        var h = cm.getNumberFromQuestInfo(993000501, "damage");
                        if (h <= e / 100) {
                            cm.gainSubAchievement(602, 0);
                            cm.gainItem(2434634, 1)
                        } else {
                            if (h <= e / 20) {
                                cm.gainSubAchievement(602, 1);
                                cm.gainItem(2434634, 1);
                                cm.gainItem(2434635, 1)
                            } else {
                                if (h <= e / 10) {
                                    cm.gainSubAchievement(602, 2);
                                    cm.gainItem(2434635, 2)
                                } else {
                                    cm.gainItem(2434636, 1);
                                    cm.gainSubAchievement(602, 3);
                                    cm.finishAchievement(603)
                                }
                            }
                        }
                        cm.updateAchievement(598, 0, 1, 10);
                        cm.updateAchievement(599, 0, 1, 100);
                        cm.updateAchievement(600, 0, 1, 1000);
                        cm.updateAchievement(601, 0, 1, 1000);
                        cm.updateInfoQuest(16150, "");
                        cm.forceForfeitQuest(15148);
                        cm.updateInfoQuest(100020, "FWEXP=0");
                        cm.gainExp(h);
                        cm.updateInfoQuest(993000501, "0");
                        cm.addNumberForQuestInfo(16407, "count", 1);
                        if (!cm.isQuestFinished(64988)) {
                            cm.forceCompleteQuest(64988)
                        }
                    }
                }
            }
        }
    }
}

function action分支1(g, d, c, a) {
    if (status <= a++) {
        cm.sendNormalTalk("呼……这次的狩猎很难啊。\r\n跟你长相比起来，实力还不错嘛？谢啦。", 5, 9001059, false, true)
    } else {
        if (status === a++) {
            cm.sendNormalTalk("日后只要你认真狩猎，就能遇到我们#r#e赏金猎人兄弟#n#k。", 5, 9001059, true, true)
        } else {
            if (status === a++) {
                var b = cm.getNumberFromQuestCustomData(9930001);
                if (b <= 2) {
                    var e = 2434634
                } else {
                    if (b <= 4) {
                        var e = 2434634
                    } else {
                        if (b <= 5) {
                            var e = 2434635
                        } else {
                            var e = 2434636
                        }
                    }
                }
                cm.updateAchievement(589, 0, 1, 10);
                cm.updateAchievement(590, 0, 1, 100);
                cm.updateAchievement(591, 0, 1, 1000);
                cm.updateAchievement(592, 0, 1, 1000);
                cm.sendNormalTalk("这是给你的#i" + e + ":# #b#t" + e + "##k和#b经验值#k。我就送你回到我们当初见面的地方吧，慢走。", 5, 9001059, true, true)
            } else {
                if (status === a++) {
                    var b = cm.getNumberFromQuestCustomData(9930001);
                    var h = cm.getPlayer().getLevel();
                    if (b <= 2) {
                        cm.gainItem(2434634, 1);
                        cm.gainExp(Math.pow(h, 3))
                    } else {
                        if (b <= 4) {
                            cm.gainItem(2434634, 2);
                            cm.gainExp(Math.pow(h, 3.5))
                        } else {
                            if (b <= 5) {
                                cm.gainItem(2434635, 2);
                                cm.gainExp(Math.pow(h, 4))
                            } else {
                                cm.gainItem(2434636, 1);
                                cm.gainExp(Math.pow(h, 4.5))
                            }
                        }
                    }
                    cm.updateInfoQuest(16150, "");
                    cm.dispose();
                    if (!cm.isQuestFinished(64986)) {
                        cm.forceCompleteQuest(64986)
                    }
                    var f = cm.getNumberFromQuestCustomData(993000500);
                    if (isNaN(f) || f < 1) {
                        f = 950000100
                    }
                    cm.warp(f, 0)
                }
            }
        }
    }
}

function action分支2(g, d, c, a) {
    if (status <= a++) {
        cm.sendNormalTalk("呼……这次的狩猎很难啊。\r\n跟你长相比起来，实力还不错嘛？谢啦。", 5, 9001059, false, true)
    } else {
        if (status === a++) {
            cm.sendNormalTalk("日后只要你认真狩猎，就能遇到我们#r#e赏金猎人兄弟#n#k。", 5, 9001059, true, true)
        } else {
            if (status === a++) {
                var b = cm.getNumberFromQuestCustomData(9930001);
                if (b == 1) {
                    var e = 2434634
                } else {
                    if (b == 2) {
                        var e = 2434634
                    } else {
                        if (b == 3) {
                            var e = 2434635
                        } else {
                            var e = 2434636
                        }
                    }
                }
                cm.updateAchievement(593, 0, 1, 10);
                cm.updateAchievement(594, 0, 1, 100);
                cm.updateAchievement(595, 0, 1, 1000);
                cm.updateAchievement(596, 0, 1, 1000);
                cm.sendNormalTalk("这是给你的#i" + e + ":# #b#t" + e + "##k和#b经验值#k。我就送你回到我们当初见面的地方吧，慢走。", 5, 9001059, true, true)
            } else {
                if (status === a++) {
                    var b = cm.getNumberFromQuestCustomData(9930001);
                    var h = cm.getPlayer().getLevel();
                    if (b == 1) {
                        cm.gainItem(2434634, 1);
                        cm.gainExp(Math.pow(h, 3))
                    } else {
                        if (b == 2) {
                            cm.gainItem(2434634, 2);
                            cm.gainExp(Math.pow(h, 3.5))
                        } else {
                            if (b == 3) {
                                cm.gainItem(2434635, 2);
                                cm.gainExp(Math.pow(h, 4))
                            } else {
                                cm.gainItem(2434636, 1);
                                cm.gainExp(Math.pow(h, 4.5))
                            }
                        }
                    }
                    cm.updateInfoQuest(16150, "");
                    cm.dispose();
                    if (!cm.isQuestFinished(64986)) {
                        cm.forceCompleteQuest(64986)
                    }
                    var f = cm.getNumberFromQuestCustomData(993000500);
                    if (isNaN(f) || f < 1) {
                        f = 950000100
                    }
                    cm.warp(f, 0)
                }
            }
        }
    }
}

function action分支6(g, d, c, a) {
    if (status <= a++) {
        cm.sendNormalTalk("呼……这次的狩猎很难啊。\r\n跟你长相比起来，实力还不错嘛？谢啦。", 5, 9001059, false, true)
    } else {
        if (status === a++) {
            cm.sendNormalTalk("日后只要你认真狩猎，就能遇到我们#r#e赏金猎人兄弟#n#k。", 5, 9001059, true, true)
        } else {
            if (status === a++) {
                var b = cm.getNumberFromQuestCustomData(9930001);
                if (b <= 10) {
                    var e = 2434634
                } else {
                    if (b <= 20) {
                        var e = 2434634
                    } else {
                        if (b <= 40) {
                            var e = 2434635
                        } else {
                            var e = 2434636
                        }
                    }
                }
                cm.sendNormalTalk("这是给你的#i" + e + ":# #b#t" + e + "##k和#b经验值#k。我就送你回到我们当初见面的地方吧，慢走。", 5, 9001059, true, true)
            } else {
                if (status === a++) {
                    var b = cm.getNumberFromQuestCustomData(9930001);
                    var h = cm.getPlayer().getLevel();
                    if (b <= 5) {
                        cm.gainItem(2434634, 1);
                        cm.gainExp(Math.pow(h, 3))
                    } else {
                        if (b <= 10) {
                            cm.gainItem(2434634, 2);
                            cm.gainExp(Math.pow(h, 3.5))
                        } else {
                            if (b <= 20) {
                                cm.gainItem(2434635, 2);
                                cm.gainExp(Math.pow(h, 4))
                            } else {
                                cm.gainItem(2434636, 1);
                                cm.gainExp(Math.pow(h, 4.5))
                            }
                        }
                    }
                    cm.updateInfoQuest(16150, "");
                    cm.dispose();
                    if (!cm.isQuestFinished(64986)) {
                        cm.forceCompleteQuest(64986)
                    }
                    var f = cm.getNumberFromQuestCustomData(993000500);
                    if (isNaN(f) || f < 1) {
                        f = 950000100
                    }
                    cm.warp(f, 0)
                }
            }
        }
    }
};